﻿namespace LinqToYQL.TestConsole
{
    using CommonServiceLocator.SpringAdapter;
    using Engine.Managers;
    using Microsoft.Practices.ServiceLocation;
    using Spring.Context.Support;
    using System;
    using TransferObjects;

    class Program
    {
        static void Main(string[] args)
        {

            CodeConfigApplicationContext appContext = new CodeConfigApplicationContext();
            appContext.ScanAllAssemblies();
            appContext.Refresh();
            ServiceLocator.SetLocatorProvider(() => new SpringServiceLocatorAdapter(appContext.ObjectFactory)); 

            IYahooServiceRequestor service = ServiceLocator.Current.GetInstance<IYahooServiceRequestor>();

            //YahooResponse response = service.Execute("select * from yahoo.finance.quotes where symbol in (\"YHOO\")");
            YahooResponse response = service.Execute("show tables");

            Console.WriteLine(response.ResponseString);
            Console.ReadLine();
        }
    }
}
